//===== eAthena Script ======================================= 
//= * ˳ƨr}<=˳ƼgWAWr *
//===== By: ================================================== 
//= Lupus
//===== Current Version: ===================================== 
//= 1.0
//===== Compatible With: ===================================== 
//= eAthena 1
//===== Description: ========================================= 
//= Write you name on your rare equipment or weapon ^_-
//= Original X-Mas mini-quest(could be used as a permanent one)
//===== Additional Comments: ================================= 
//= 1.0 First release
//===== : ================================= 
//= u@ë 2006/02/16
//============================================================

prt_in,24,61,7	script	Q۾{ѥͪ	47,{
	mes "[Q۾{ѥͪ]";
	if(BaseJob==Job_Novice || BaseLevel<50) {
		mes "nN,ڤUsH,hhmma.";
		emotion e_sry;
		close;
	}
	mes "n,گ ^000090AWr^000000 A⤤Z@!.";
	next;
	menu "hH...",-, "еڪZWڪWr",M_DO;

	mes "[Q۾{ѥͪ]";
	mes "ڥiHN˳ƩMZWAWr.";
	emotion e_ic;
	next;
	mes "[Q۾{ѥͪ]";
	mes "@Pe,ڪڸѶF,ڤD^.";
	next;
	mes "[Q۾{ѥͪ]";
	mes "ڪu@OH ^0000803 §c^000000";
	mes "[W ^FF00005000z^000000 ӵZr.";
	next;
	emotion e_cry;
	mes "[Q۾{ѥͪ]";
	mes "DDAF ٦12ӰjĤl";
	mes "M@ӥͮ𪺦ѱC.";
	next;
	mes "[Q۾{ѥͪ]";
	mes "@...F,O12ӥͮ𪺫Ĥl";
	mes "MQjѱC...";
	emotion e_hmm;
	close;

M_DO:
	mes "[Q۾{ѥͪ]";
	mes "ڬݬݧAaӪF...";
M_MENU:
	next;
	menu getequipname(1),M_PART1,getequipname(9),M_PART9,getequipname(10),M_PART10,getequipname(2),M_PART2,getequipname(4),M_PART4,
	     getequipname(3),M_PART3,getequipname(5),M_PART5,getequipname(6),M_PART6,getequipname(7),M_PART7,getequipname(8),M_PART8;

	//Head Gear
	M_PART1:
		set @part,1;
		if (getequipisequiped(1)) goto L_CHECK1;
		mes "[Q۾{ѥͪ]";
		mes "rY۷Gv... SȱohgWWr.";
		emotion 6;
		goto M_MENU;
	M_PART9:
		set @part,9;
		if (getequipisequiped(9)) goto L_CHECK1;
		mes "[Q۾{ѥͪ]";
		mes "AW褧F...";
		emotion 20;
		goto M_MENU;
	M_PART10:
		set @part,10;
		if (getequipisequiped(10)) goto L_CHECK1;
		mes "[Q۾{ѥͪ]";
		mes "K,AO.";
		emotion 20;
		goto M_MENU;
	//Armor
	M_PART2:
		set @part,2;
		if (getequipisequiped(2)) goto L_CHECK1;
		mes "[Q۾{ѥͪ]";
		mes "A?pΨ{@!.";
		emotion 6;
		goto M_MENU;
	//Left Hand
	M_PART3:
		set @part,3;
		if (getequipisequiped(3)) goto L_CHECK1;
		mes "[Q۾{ѥͪ]";
		mes "Ar? ڤOd,AD...";
		emotion 4;
		goto M_MENU;
	//Right Hand
	M_PART4:
		set @part,4;
		if (getequipisequiped(4)) goto L_CHECK1;
		mes "[Q۾{ѥͪ]";
		mes "SF,ud!Цnn~!!.";
		emotion 4;
		goto M_MENU;
	//Garment
	M_PART5:
		set @part,5;
		if (getequipisequiped(5)) goto L_CHECK1;
		mes "[Q۾{ѥͪ]";
		mes "!ŪŦp]...";
		goto M_MENU;
	//Foot Gear
	M_PART6:
		set @part,6;
		if (getequipisequiped(6)) goto L_CHECK1;
		mes "[Q۾{ѥͪ]";
		mes "@!ڤw}.";
		emotion 16;
		goto M_MENU;
	//Accessory1
	M_PART7:
		set @part,7;
		if (getequipisequiped(7)) goto L_CHECK1;
		mes "[Q۾{ѥͪ]";
		mes "M?AfU̦Ӥj}...";
		emotion 20;
		goto M_MENU;
	//Accessory2
	M_PART8:
		set @part,8;
		if (getequipisequiped(8)) goto L_CHECK1;
		mes "[Q۾{ѥͪ]";
		mes "ڬݨApΨ{F...";
		emotion 20;
		goto M_MENU;

L_CHECK1:
	set @ref,0;
	set @id,getequipid(@part);
	if(getequipisidentify(@part)) goto L_CHECK2;
	mes "[Q۾{ѥͪ]";
	mes "A˳ƤFhD?";
	npctalk "ڭnBSA!";
	emotion e_wah;
	close;

L_CHECK2:
	set @ref,getequiprefinerycnt(@part);
	mes "[Q۾{ѥͪ]";
	mes "AQ "+getitemname(@id)+"Wr?...";
	if(BaseJob==Job_Novice) {
		mes "ڱqӤǪ̷doتN.";
		emotion e_sry;
		goto M_MENU;
	}
	set @slot0,getequipcardid(@part,0);
	set @slot1,getequipcardid(@part,1);
	set @slot2,getequipcardid(@part,2);
	set @slot3,getequipcardid(@part,3);

	if(@slot0==255 || @slot0==254 || @slot0<0) {
		mes "nF,.";
		mes "ݨӧڥiHQѶWF.";
		emotion e_hmm;
		goto M_MENU;
	}
	if(@slot0>4000 && @slot0<5000) {
		mes "o̦d?!";
		mes "ڬOOL,ڱqd˳ƨr.";
		emotion e_hmm;
		goto M_MENU;
	}
	if(getiteminfo(@id,10)) {
		mes "nN,ڤ}˳ƨr.";
		emotion e_sry;
		goto M_MENU;
	}

	if(@ref)mes "Lݭn "+@ref+" ɶ... CW[ ^FF00005000z^000000.";
	mes " ^0000803 §c^000000";
	if(@ref)mes "M ^FF0000"+(5000*@ref)+"z^000000.";
	next;
	menu "n!",-, "}",M_END;
	if(Zeny>=(5000*@ref) && countitem(644)>=3) {
		delitem 644,3;
		set Zeny,Zeny-(5000*@ref);
		goto L_MAKE;
	}
	mes "[Q۾{ѥͪ]";
	mes "ڤu@q.";
	emotion e_sry;
	close;

L_MAKE:
	if(countitem2(@id,1,@ref,0,@slot0,@slot1,@slot2,@slot3)==0) {
		mes "[Q۾{ѥͪ]";
		mes "̦... "+getitemname(@id)+"?";
		npctalk "ڭnBSA!";
		logmes "CHEATER: յLSFr: "+getitemname(@id);
		emotion e_wah;
		close;
	}
	delitem2 @id,1,1,@ref,0,@slot0,@slot1,@slot2,@slot3;

	mes "[Q۾{ѥͪ]";
	mes "nF!";
	emotion e_proud;

	getitem2 @id,1,1,@ref,0,254,0,getcharid(0)&0xffff,(getcharid(0)>>16)&0xffff;
	close;

M_END:
	mes "[Q۾{ѥͪ]";
	mes "A...";
	emotion e_yawn;
	close;
}
